<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
  Date.prototype.Format = function (fmt) { //author: meizz
    var o = {
      "M+": this.getMonth() + 1, //月份
      "d+": this.getDate(), //日
      "h+": this.getHours(), //小时
      "m+": this.getMinutes(), //分
      "s+": this.getSeconds(), //秒
      "q+": Math.floor((this.getMonth() + 3) / 3), //季度
      "S": this.getMilliseconds() //毫秒
    };
    if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
      if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
  }
  function chiocePlaceInfectionRecord(id,li){
    loadDiv('placeDiv','${ctx}/doctor/placeInfectionRecord/form?id='+id);
    $(li).parent().find("li").attr("style","background-color:#EBEBEB");
    $(li).attr("style","background-color:#F7F7F7");
  }
  function addPlaceInfectionRecord(clinicId,patientId){
    $("#showInfection li:first").attr("style","background-color:#EBEBEB");
    loadDiv('placeDiv','${ctx}/doctor/placeInfectionRecord/addPlaceInfectionRecord?clinicId='+clinicId+'&patientId='+patientId);
  }
  if($("#showInfection li:first").html()=='' ||$("#showInfection li:first").html()==null){
    $("#addPlaceInfection").click();
  }else{
    $("#showInfection li:first").click();
  }

</script>
<div class="panel-body">
  <div class="col-lg-2" style="position:absolute;">
    <ul class="nav nav-stacked">
        <label class="navbar-text">填卡日期&nbsp;&nbsp;
          <button id="addPlaceInfection" onclick="addPlaceInfectionRecord('${clinicMaster.id}','${patMasterIndex.id}')">新建</button></label>
    </ul>
    <ul class="nav nav-stacked" id="showInfection">
      <c:forEach items="${placeInfection}" var="o">
        <li onclick="chiocePlaceInfectionRecord('${o.id}',this)" style="border-bottom: 1px;">
          <fmt:formatDate value="${o.writeDate}" pattern="yyyy年MM月dd日" type="date" dateStyle="long" />
        </li>
      </c:forEach>
    </ul>
    <ul>

    </ul>
  </div>
  <div class="col-lg-10" style="float: right" id="placeDiv">

  </div>
</div>